package com.gecco.crawler;

import com.geccocrawler.gecco.GeccoEngine;
import com.geccocrawler.gecco.request.HttpGetRequest;
import com.geccocrawler.gecco.request.HttpRequest;

public class Main {
    public static void main(String[] args) {
        System.out.println("========================== start ==========================");
        
        String url = "http://news.iresearch.cn/";
        HttpRequest request = new HttpGetRequest(url);
        request.setCharset("GBK");
        
        GeccoEngine.create()
                //Gecco搜索的包路径
                .classpath("com.gecco.crawler")
                //开始抓取的页面地址
                .start(request)
                //开启几个爬虫线程
                .thread(2)
                //单个爬虫每次抓取完一个请求后的间隔时间:3s
                .interval(3000)
                .run();
    }
}
